home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / schmrprt / r395rs.lha / basic.tex < prev    next >
LaTeX Document  |  1989-03-12  |  7.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 5c 76 66 69 6c 6c 5c | 65 6a 65 63 74 0a 5c 63 |%\vfill\|eject.\c|
|00000010| 68 61 70 74 65 72 7b 42 | 61 73 69 63 20 63 6f 6e |hapter{B|asic con|
|00000020| 63 65 70 74 73 7d 0a 5c | 6c 61 62 65 6c 7b 62 61 |cepts}.\|label{ba|
|00000030| 73 69 63 63 68 61 70 74 | 65 72 7d 0a 0a 5c 73 65 |sicchapt|er}..\se|
|00000040| 63 74 69 6f 6e 7b 56 61 | 72 69 61 62 6c 65 73 20 |ction{Va|riables |
|00000050| 61 6e 64 20 72 65 67 69 | 6f 6e 73 7d 0a 5c 6c 61 |and regi|ons}.\la|
|00000060| 62 65 6c 7b 73 70 65 63 | 69 61 6c 66 6f 72 6d 73 |bel{spec|ialforms|
|00000070| 65 63 74 69 6f 6e 7d 0a | 5c 6c 61 62 65 6c 7b 76 |ection}.|\label{v|
|00000080| 61 72 69 61 62 6c 65 73 | 65 63 74 69 6f 6e 7d 0a |ariables|ection}.|
|00000090| 0a 41 6e 79 20 69 64 65 | 6e 74 69 66 69 65 72 20 |.Any ide|ntifier |
|000000a0| 74 68 61 74 20 69 73 20 | 6e 6f 74 20 61 20 73 79 |that is |not a sy|
|000000b0| 6e 74 61 63 74 69 63 20 | 6b 65 79 77 6f 72 64 5c |ntactic |keyword\|
|000000c0| 69 6e 64 65 78 7b 6b 65 | 79 77 6f 72 64 7d 20 28 |index{ke|yword} (|
|000000d0| 73 65 65 0a 73 65 63 74 | 69 6f 6e 7e 5c 72 65 66 |see.sect|ion~\ref|
|000000e0| 7b 6b 65 79 77 6f 72 64 | 73 65 63 74 69 6f 6e 7d |{keyword|section}|
|000000f0| 29 20 6d 61 79 20 62 65 | 20 75 73 65 64 20 61 73 |) may be| used as|
|00000100| 20 61 20 76 61 72 69 61 | 62 6c 65 2e 5c 69 6e 64 | a varia|ble.\ind|
|00000110| 65 78 7b 73 79 6e 74 61 | 63 74 69 63 0a 6b 65 79 |ex{synta|ctic.key|
|00000120| 77 6f 72 64 7d 5c 69 6e | 64 65 78 7b 69 64 65 6e |word}\in|dex{iden|
|00000130| 74 69 66 69 65 72 7d 5c | 6d 61 69 6e 69 6e 64 65 |tifier}\|maininde|
|00000140| 78 7b 76 61 72 69 61 62 | 6c 65 7d 20 20 41 20 76 |x{variab|le} A v|
|00000150| 61 72 69 61 62 6c 65 20 | 6d 61 79 20 6e 61 6d 65 |ariable |may name|
|00000160| 20 61 0a 6c 6f 63 61 74 | 69 6f 6e 20 77 68 65 72 | a.locat|ion wher|
|00000170| 65 20 61 20 76 61 6c 75 | 65 20 63 61 6e 20 62 65 |e a valu|e can be|
|00000180| 20 73 74 6f 72 65 64 2e | 20 20 41 20 76 61 72 69 | stored.| A vari|
|00000190| 61 62 6c 65 20 74 68 61 | 74 20 64 6f 65 73 20 73 |able tha|t does s|
|000001a0| 6f 20 69 73 20 73 61 69 | 64 0a 74 6f 20 62 65 20 |o is sai|d.to be |
|000001b0| 7b 5c 65 6d 20 62 6f 75 | 6e 64 7d 20 74 6f 20 74 |{\em bou|nd} to t|
|000001c0| 68 65 20 6c 6f 63 61 74 | 69 6f 6e 2e 20 20 54 68 |he locat|ion. Th|
|000001d0| 65 20 73 65 74 20 6f 66 | 20 61 6c 6c 20 73 75 63 |e set of| all suc|
|000001e0| 68 0a 62 69 6e 64 69 6e | 67 73 5c 6d 61 69 6e 69 |h.bindin|gs\maini|
|000001f0| 6e 64 65 78 7b 62 69 6e | 64 69 6e 67 7d 20 69 6e |ndex{bin|ding} in|
|00000200| 20 65 66 66 65 63 74 20 | 61 74 20 73 6f 6d 65 20 | effect |at some |
|00000210| 70 6f 69 6e 74 20 69 6e | 20 61 20 70 72 6f 67 72 |point in| a progr|
|00000220| 61 6d 20 69 73 0a 6b 6e | 6f 77 6e 20 61 73 20 74 |am is.kn|own as t|
|00000230| 68 65 20 7b 5c 65 6d 20 | 65 6e 76 69 72 6f 6e 6d |he {\em |environm|
|00000240| 65 6e 74 7d 20 69 6e 20 | 65 66 66 65 63 74 20 61 |ent} in |effect a|
|00000250| 74 20 74 68 61 74 20 70 | 6f 69 6e 74 2e 20 20 54 |t that p|oint. T|
|00000260| 68 65 20 76 61 6c 75 65 | 0a 73 74 6f 72 65 64 20 |he value|.stored |
|00000270| 69 6e 20 74 68 65 20 6c | 6f 63 61 74 69 6f 6e 20 |in the l|ocation |
|00000280| 74 6f 20 77 68 69 63 68 | 20 61 20 76 61 72 69 61 |to which| a varia|
|00000290| 62 6c 65 20 69 73 20 62 | 6f 75 6e 64 20 69 73 20 |ble is b|ound is |
|000002a0| 63 61 6c 6c 65 64 20 74 | 68 65 0a 76 61 72 69 61 |called t|he.varia|
|000002b0| 62 6c 65 27 73 20 76 61 | 6c 75 65 2e 20 20 42 79 |ble's va|lue. By|
|000002c0| 20 61 62 75 73 65 20 6f | 66 20 74 65 72 6d 69 6e | abuse o|f termin|
|000002d0| 6f 6c 6f 67 79 2c 20 74 | 68 65 20 76 61 72 69 61 |ology, t|he varia|
|000002e0| 62 6c 65 20 69 73 20 73 | 6f 6d 65 74 69 6d 65 73 |ble is s|ometimes|
|000002f0| 0a 73 61 69 64 20 74 6f | 20 6e 61 6d 65 20 74 68 |.said to| name th|
|00000300| 65 20 76 61 6c 75 65 20 | 6f 72 20 74 6f 20 62 65 |e value |or to be|
|00000310| 20 62 6f 75 6e 64 20 74 | 6f 20 74 68 65 20 76 61 | bound t|o the va|
|00000320| 6c 75 65 2e 20 20 54 68 | 69 73 20 69 73 20 6e 6f |lue. Th|is is no|
|00000330| 74 20 71 75 69 74 65 0a | 61 63 63 75 72 61 74 65 |t quite.|accurate|
|00000340| 2c 20 62 75 74 20 63 6f | 6e 66 75 73 69 6f 6e 20 |, but co|nfusion |
|00000350| 72 61 72 65 6c 79 20 72 | 65 73 75 6c 74 73 20 66 |rarely r|esults f|
|00000360| 72 6f 6d 20 74 68 69 73 | 20 70 72 61 63 74 69 63 |rom this| practic|
|00000370| 65 2e 0a 0a 5c 74 6f 64 | 6f 7b 44 65 66 69 6e 65 |e...\tod|o{Define|
|00000380| 20 60 60 61 73 73 69 67 | 6e 65 64 27 27 20 61 6e | ``assig|ned'' an|
|00000390| 64 20 60 60 75 6e 61 73 | 73 69 67 6e 65 64 27 27 |d ``unas|signed''|
|000003a0| 20 70 65 72 68 61 70 73 | 3f 7d 0a 0a 5c 74 6f 64 | perhaps|?}..\tod|
|000003b0| 6f 7b 49 6e 20 70 72 6f | 67 72 61 6d 73 20 77 69 |o{In pro|grams wi|
|000003c0| 74 68 6f 75 74 20 73 69 | 64 65 20 65 66 66 65 63 |thout si|de effec|
|000003d0| 74 73 2c 20 6f 6e 65 20 | 63 61 6e 20 73 61 66 65 |ts, one |can safe|
|000003e0| 6c 79 20 70 72 65 74 65 | 6e 64 20 74 68 61 74 20 |ly prete|nd that |
|000003f0| 74 68 65 0a 76 61 72 69 | 61 62 6c 65 73 20 61 72 |the.vari|ables ar|
|00000400| 65 20 62 6f 75 6e 64 20 | 64 69 72 65 63 74 6c 79 |e bound |directly|
|00000410| 20 74 6f 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 | to the |argument|
|00000420| 73 2e 20 20 4f 72 3a 0a | 49 6e 20 70 72 6f 67 72 |s. Or:.|In progr|
|00000430| 61 6d 73 20 77 69 74 68 | 6f 75 74 20 5c 69 64 65 |ams with|out \ide|
|00000440| 7b 73 65 74 21 7d 2c 20 | 6f 6e 65 20 63 61 6e 20 |{set!}, |one can |
|00000450| 73 61 66 65 6c 79 20 70 | 72 65 74 65 6e 64 20 74 |safely p|retend t|
|00000460| 68 61 74 20 74 68 65 0a | 76 61 72 69 61 62 6c 65 |hat the.|variable|
|00000470| 20 69 73 20 62 6f 75 6e | 64 20 64 69 72 65 63 74 | is boun|d direct|
|00000480| 6c 79 20 74 6f 20 74 68 | 65 20 76 61 6c 75 65 2e |ly to th|e value.|
|00000490| 20 7d 0a 0a 5c 76 65 73 | 74 20 43 65 72 74 61 69 | }..\ves|t Certai|
|000004a0| 6e 20 65 78 70 72 65 73 | 73 69 6f 6e 20 74 79 70 |n expres|sion typ|
|000004b0| 65 73 20 61 72 65 20 75 | 73 65 64 20 74 6f 20 63 |es are u|sed to c|
|000004c0| 72 65 61 74 65 20 6e 65 | 77 20 6c 6f 63 61 74 69 |reate ne|w locati|
|000004d0| 6f 6e 73 20 61 6e 64 20 | 74 6f 0a 62 69 6e 64 20 |ons and |to.bind |
|000004e0| 76 61 72 69 61 62 6c 65 | 73 20 74 6f 20 74 68 6f |variable|s to tho|
|000004f0| 73 65 20 6c 6f 63 61 74 | 69 6f 6e 73 2e 20 20 54 |se locat|ions. T|
|00000500| 68 65 20 6d 6f 73 74 20 | 66 75 6e 64 61 6d 65 6e |he most |fundamen|
|00000510| 74 61 6c 20 6f 66 20 74 | 68 65 73 65 20 7b 5c 65 |tal of t|hese {\e|
|00000520| 6d 0a 62 69 6e 64 69 6e | 67 20 63 6f 6e 73 74 72 |m.bindin|g constr|
|00000530| 75 63 74 73 7d 5c 6d 61 | 69 6e 69 6e 64 65 78 7b |ucts}\ma|inindex{|
|00000540| 62 69 6e 64 69 6e 67 20 | 63 6f 6e 73 74 72 75 63 |binding |construc|
|00000550| 74 7d 20 69 73 20 74 68 | 65 0a 5c 6c 61 6d 62 64 |t} is th|e.\lambd|
|00000560| 61 65 78 70 7b 7d 5c 69 | 6e 64 65 78 7b 5c 6c 61 |aexp{}\i|ndex{\la|
|00000570| 6d 62 64 61 65 78 70 7b | 7d 7d 2c 20 62 65 63 61 |mbdaexp{|}}, beca|
|00000580| 75 73 65 20 61 6c 6c 20 | 6f 74 68 65 72 20 62 69 |use all |other bi|
|00000590| 6e 64 69 6e 67 20 63 6f | 6e 73 74 72 75 63 74 73 |nding co|nstructs|
|000005a0| 0a 63 61 6e 20 62 65 20 | 65 78 70 6c 61 69 6e 65 |.can be |explaine|
|000005b0| 64 20 69 6e 20 74 65 72 | 6d 73 20 6f 66 20 5c 6c |d in ter|ms of \l|
|000005c0| 61 6d 62 64 61 65 78 70 | 7b 7d 73 2e 20 20 54 68 |ambdaexp|{}s. Th|
|000005d0| 65 20 6f 74 68 65 72 20 | 62 69 6e 64 69 6e 67 0a |e other |binding.|
|000005e0| 63 6f 6e 73 74 72 75 63 | 74 73 20 61 72 65 20 5c |construc|ts are \|
|000005f0| 69 64 65 7b 6c 65 74 7d | 2c 20 5c 69 64 65 7b 6c |ide{let}|, \ide{l|
|00000600| 65 74 2a 7d 2c 20 5c 69 | 64 65 7b 6c 65 74 72 65 |et*}, \i|de{letre|
|00000610| 63 7d 2c 20 61 6e 64 20 | 5c 69 64 65 7b 64 6f 7d |c}, and |\ide{do}|
|00000620| 0a 65 78 70 72 65 73 73 | 69 6f 6e 73 20 28 73 65 |.express|ions (se|
|00000630| 65 20 73 65 63 74 69 6f | 6e 73 7e 5c 72 65 66 7b |e sectio|ns~\ref{|
|00000640| 6c 61 6d 62 64 61 7d 2c | 20 5c 72 65 66 7b 6c 65 |lambda},| \ref{le|
|00000650| 74 72 65 63 7d 2c 20 61 | 6e 64 20 5c 72 65 66 7b |trec}, a|nd \ref{|
|00000660| 64 6f 7d 29 2e 0a 0a 25 | 4e 6f 74 65 3a 20 69 6e |do})...%|Note: in|
|00000670| 74 65 72 6e 61 6c 20 64 | 65 66 69 6e 69 74 69 6f |ternal d|efinitio|
|00000680| 6e 73 20 6e 6f 74 20 6d | 65 6e 74 69 6f 6e 65 64 |ns not m|entioned|
|00000690| 20 68 65 72 65 2e 0a 0a | 5c 76 65 73 74 20 4c 69 | here...|\vest Li|
|000006a0| 6b 65 20 41 6c 67 6f 6c | 20 61 6e 64 20 50 61 73 |ke Algol| and Pas|
|000006b0| 63 61 6c 2c 20 61 6e 64 | 20 75 6e 6c 69 6b 65 20 |cal, and| unlike |
|000006c0| 6d 6f 73 74 20 6f 74 68 | 65 72 20 64 69 61 6c 65 |most oth|er diale|
|000006d0| 63 74 73 20 6f 66 20 4c | 69 73 70 0a 65 78 63 65 |cts of L|isp.exce|
|000006e0| 70 74 20 66 6f 72 20 43 | 6f 6d 6d 6f 6e 20 4c 69 |pt for C|ommon Li|
|000006f0| 73 70 2c 20 53 63 68 65 | 6d 65 20 69 73 20 61 20 |sp, Sche|me is a |
|00000700| 73 74 61 74 69 63 61 6c | 6c 79 20 73 63 6f 70 65 |statical|ly scope|
|00000710| 64 20 6c 61 6e 67 75 61 | 67 65 20 77 69 74 68 0a |d langua|ge with.|
|00000720| 62 6c 6f 63 6b 20 73 74 | 72 75 63 74 75 72 65 2e |block st|ructure.|
|00000730| 20 20 54 6f 20 65 61 63 | 68 20 70 6c 61 63 65 20 | To eac|h place |
|00000740| 77 68 65 72 65 20 61 20 | 76 61 72 69 61 62 6c 65 |where a |variable|
|00000750| 20 69 73 20 62 6f 75 6e | 64 20 69 6e 20 61 20 70 | is boun|d in a p|
|00000760| 72 6f 67 72 61 6d 0a 74 | 68 65 72 65 20 63 6f 72 |rogram.t|here cor|
|00000770| 72 65 73 70 6f 6e 64 73 | 20 61 20 5c 64 65 66 69 |responds| a \defi|
|00000780| 6e 69 6e 67 7b 72 65 67 | 69 6f 6e 7d 20 6f 66 20 |ning{reg|ion} of |
|00000790| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 74 65 78 74 |the prog|ram text|
|000007a0| 20 77 69 74 68 69 6e 20 | 77 68 69 63 68 0a 74 68 | within |which.th|
|000007b0| 65 20 62 69 6e 64 69 6e | 67 20 69 73 20 65 66 66 |e bindin|g is eff|
|000007c0| 65 63 74 69 76 65 2e 20 | 20 54 68 65 20 72 65 67 |ective. | The reg|
|000007d0| 69 6f 6e 20 69 73 20 64 | 65 74 65 72 6d 69 6e 65 |ion is d|etermine|
|000007e0| 64 20 62 79 20 74 68 65 | 20 70 61 72 74 69 63 75 |d by the| particu|
|000007f0| 6c 61 72 0a 62 69 6e 64 | 69 6e 67 20 63 6f 6e 73 |lar.bind|ing cons|
|00000800| 74 72 75 63 74 20 74 68 | 61 74 20 65 73 74 61 62 |truct th|at estab|
|00000810| 6c 69 73 68 65 73 20 74 | 68 65 20 62 69 6e 64 69 |lishes t|he bindi|
|00000820| 6e 67 3b 20 69 66 20 74 | 68 65 20 62 69 6e 64 69 |ng; if t|he bindi|
|00000830| 6e 67 20 69 73 0a 65 73 | 74 61 62 6c 69 73 68 65 |ng is.es|tablishe|
|00000840| 64 20 62 79 20 61 20 5c | 6c 61 6d 62 64 61 65 78 |d by a \|lambdaex|
|00000850| 70 7b 7d 2c 20 66 6f 72 | 20 65 78 61 6d 70 6c 65 |p{}, for| example|
|00000860| 2c 20 74 68 65 6e 20 69 | 74 73 20 72 65 67 69 6f |, then i|ts regio|
|00000870| 6e 0a 69 73 20 74 68 65 | 20 65 6e 74 69 72 65 20 |n.is the| entire |
|00000880| 5c 6c 61 6d 62 64 61 65 | 78 70 7b 7d 2e 20 20 45 |\lambdae|xp{}. E|
|00000890| 76 65 72 79 20 72 65 66 | 65 72 65 6e 63 65 20 74 |very ref|erence t|
|000008a0| 6f 20 6f 72 20 61 73 73 | 69 67 6e 6d 65 6e 74 20 |o or ass|ignment |
|000008b0| 6f 66 20 61 0a 76 61 72 | 69 61 62 6c 65 20 72 65 |of a.var|iable re|
|000008c0| 66 65 72 73 20 74 6f 20 | 74 68 65 20 62 69 6e 64 |fers to |the bind|
|000008d0| 69 6e 67 20 6f 66 20 74 | 68 65 20 76 61 72 69 61 |ing of t|he varia|
|000008e0| 62 6c 65 20 74 68 61 74 | 20 65 73 74 61 62 6c 69 |ble that| establi|
|000008f0| 73 68 65 64 20 74 68 65 | 0a 69 6e 6e 65 72 6d 6f |shed the|.innermo|
|00000900| 73 74 20 6f 66 20 74 68 | 65 20 72 65 67 69 6f 6e |st of th|e region|
|00000910| 73 20 63 6f 6e 74 61 69 | 6e 69 6e 67 20 74 68 65 |s contai|ning the|
|00000920| 20 75 73 65 2e 20 20 49 | 66 20 74 68 65 72 65 20 | use. I|f there |
|00000930| 69 73 20 6e 6f 20 62 69 | 6e 64 69 6e 67 20 6f 66 |is no bi|nding of|
|00000940| 0a 74 68 65 20 76 61 72 | 69 61 62 6c 65 20 77 68 |.the var|iable wh|
|00000950| 6f 73 65 20 72 65 67 69 | 6f 6e 20 63 6f 6e 74 61 |ose regi|on conta|
|00000960| 69 6e 73 20 74 68 65 20 | 75 73 65 2c 20 74 68 65 |ins the |use, the|
|00000970| 6e 20 74 68 65 20 75 73 | 65 20 72 65 66 65 72 73 |n the us|e refers|
|00000980| 20 74 6f 20 74 68 65 0a | 62 69 6e 64 69 6e 67 20 | to the.|binding |
|00000990| 66 6f 72 20 74 68 65 20 | 76 61 72 69 61 62 6c 65 |for the |variable|
|000009a0| 20 69 6e 20 74 68 65 20 | 74 6f 70 20 6c 65 76 65 | in the |top leve|
|000009b0| 6c 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 2c 20 69 |l enviro|nment, i|
|000009c0| 66 20 61 6e 79 0a 28 73 | 65 63 74 69 6f 6e 7e 5c |f any.(s|ection~\|
|000009d0| 72 65 66 7b 69 6e 69 74 | 69 61 6c 65 6e 76 7d 29 |ref{init|ialenv})|
|000009e0| 3b 20 69 66 20 74 68 65 | 72 65 20 69 73 20 6e 6f |; if the|re is no|
|000009f0| 20 62 69 6e 64 69 6e 67 | 20 66 6f 72 20 74 68 65 | binding| for the|
|00000a00| 20 69 64 65 6e 74 69 66 | 69 65 72 2c 0a 69 74 20 | identif|ier,.it |
|00000a10| 69 73 20 73 61 69 64 20 | 74 6f 20 62 65 20 5c 64 |is said |to be \d|
|00000a20| 65 66 69 6e 69 6e 67 7b | 75 6e 62 6f 75 6e 64 7d |efining{|unbound}|
|00000a30| 2e 5c 6d 61 69 6e 69 6e | 64 65 78 7b 62 6f 75 6e |.\mainin|dex{boun|
|00000a40| 64 7d 5c 69 6e 64 65 78 | 7b 74 6f 70 20 6c 65 76 |d}\index|{top lev|
|00000a50| 65 6c 0a 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 7d 0a |el.envir|onment}.|
|00000a60| 0a 5c 74 6f 64 6f 7b 4d | 65 6e 74 69 6f 6e 20 74 |.\todo{M|ention t|
|00000a70| 68 61 74 20 73 6f 6d 65 | 20 69 6d 70 6c 65 6d 65 |hat some| impleme|
|00000a80| 6e 74 61 74 69 6f 6e 73 | 20 68 61 76 65 20 6d 75 |ntations| have mu|
|00000a90| 6c 74 69 70 6c 65 20 74 | 6f 70 20 6c 65 76 65 6c |ltiple t|op level|
|00000aa0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 73 3f 7d 0a | environ|ments?}.|
|00000ab0| 0a 5c 74 6f 64 6f 7b 50 | 69 74 6d 61 6e 20 73 65 |.\todo{P|itman se|
|00000ac0| 7a 3a 20 6e 65 65 64 73 | 20 65 6c 61 62 6f 72 61 |z: needs| elabora|
|00000ad0| 74 69 6f 6e 20 69 6e 20 | 63 61 73 65 20 6f 66 20 |tion in |case of |
|00000ae0| 7b 5c 74 74 28 6c 65 74 | 20 2e 2e 2e 29 7d 7d 0a |{\tt(let| ...)}}.|
|00000af0| 0a 5c 74 6f 64 6f 7b 50 | 69 74 6d 61 6e 20 61 73 |.\todo{P|itman as|
|00000b00| 6b 73 3a 20 73 61 79 20 | 73 6f 6d 65 74 68 69 6e |ks: say |somethin|
|00000b10| 67 20 61 62 6f 75 74 20 | 76 61 72 73 20 63 72 65 |g about |vars cre|
|00000b20| 61 74 65 64 20 61 66 74 | 65 72 20 73 63 68 65 6d |ated aft|er schem|
|00000b30| 65 20 73 74 61 72 74 73 | 3f 0a 7b 5c 74 74 20 28 |e starts|?.{\tt (|
|00000b40| 64 65 66 69 6e 65 20 78 | 20 33 29 20 28 64 65 66 |define x| 3) (def|
|00000b50| 69 6e 65 20 28 66 29 20 | 78 29 20 28 64 65 66 69 |ine (f) |x) (defi|
|00000b60| 6e 65 20 28 67 29 20 79 | 29 20 28 64 65 66 69 6e |ne (g) y|) (defin|
|00000b70| 65 20 79 20 34 29 7d 0a | 43 6c 69 6e 67 65 72 20 |e y 4)}.|Clinger |
|00000b80| 72 65 70 6c 69 65 73 3a | 20 54 68 65 20 6c 61 6e |replies:| The lan|
|00000b90| 67 75 61 67 65 20 77 61 | 73 20 65 78 70 6c 69 63 |guage wa|s explic|
|00000ba0| 69 74 6c 79 0a 64 65 73 | 69 67 6e 65 64 20 74 6f |itly.des|igned to|
|00000bb0| 20 70 65 72 6d 69 74 20 | 61 20 76 69 65 77 20 69 | permit |a view i|
|00000bc0| 6e 20 77 68 69 63 68 20 | 6e 6f 20 76 61 72 69 61 |n which |no varia|
|00000bd0| 62 6c 65 73 20 61 72 65 | 20 63 72 65 61 74 65 64 |bles are| created|
|00000be0| 20 61 66 74 65 72 0a 53 | 63 68 65 6d 65 20 73 74 | after.S|cheme st|
|00000bf0| 61 72 74 73 2e 20 20 49 | 6e 20 66 69 6c 65 73 2c |arts. I|n files,|
|00000c00| 20 79 6f 75 20 63 61 6e | 20 73 63 61 6e 20 6f 75 | you can| scan ou|
|00000c10| 74 20 74 68 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |t the de|finition|
|00000c20| 73 20 62 65 66 6f 72 65 | 68 61 6e 64 2e 0a 49 20 |s before|hand..I |
|00000c30| 74 68 69 6e 6b 20 77 65 | 27 72 65 20 61 67 72 65 |think we|'re agre|
|00000c40| 65 64 20 6f 6e 20 74 68 | 65 20 70 72 69 6e 63 69 |ed on th|e princi|
|00000c50| 70 6c 65 20 74 68 61 74 | 20 69 6e 74 65 72 61 63 |ple that| interac|
|00000c60| 74 69 76 65 20 75 73 65 | 20 73 68 6f 75 6c 64 0a |tive use| should.|
|00000c70| 61 70 70 72 6f 78 69 6d | 61 74 65 20 74 68 61 74 |approxim|ate that|
|00000c80| 20 62 65 68 61 76 69 6f | 72 20 61 73 20 63 6c 6f | behavio|r as clo|
|00000c90| 73 65 6c 79 20 61 73 20 | 70 6f 73 73 69 62 6c 65 |sely as |possible|
|00000ca0| 2c 20 74 68 6f 75 67 68 | 20 77 65 20 64 6f 6e 27 |, though| we don'|
|00000cb0| 74 20 79 65 74 0a 61 67 | 72 65 65 20 6f 6e 20 77 |t yet.ag|ree on w|
|00000cc0| 68 69 63 68 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |hich pro|gramming|
|00000cd0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 70 72 6f | environ|ment pro|
|00000ce0| 76 69 64 65 73 20 74 68 | 65 20 62 65 73 74 20 61 |vides th|e best a|
|00000cf0| 70 70 72 6f 78 69 6d 61 | 74 69 6f 6e 2e 7d 0a 0a |pproxima|tion.}..|
|00000d00| 0a 5c 73 65 63 74 69 6f | 6e 7b 54 72 75 65 20 61 |.\sectio|n{True a|
|00000d10| 6e 64 20 66 61 6c 73 65 | 7d 0a 0a 41 6e 79 20 53 |nd false|}..Any S|
|00000d20| 63 68 65 6d 65 20 76 61 | 6c 75 65 20 63 61 6e 20 |cheme va|lue can |
|00000d30| 62 65 20 75 73 65 64 20 | 61 73 20 61 20 62 6f 6f |be used |as a boo|
|00000d40| 6c 65 61 6e 20 76 61 6c | 75 65 20 66 6f 72 20 74 |lean val|ue for t|
|00000d50| 68 65 20 70 75 72 70 6f | 73 65 20 6f 66 20 61 0a |he purpo|se of a.|
|00000d60| 63 6f 6e 64 69 74 69 6f | 6e 61 6c 20 74 65 73 74 |conditio|nal test|
|00000d70| 2e 20 20 41 73 20 65 78 | 70 6c 61 69 6e 65 64 20 |. As ex|plained |
|00000d80| 69 6e 20 73 65 63 74 69 | 6f 6e 7e 5c 72 65 66 7b |in secti|on~\ref{|
|00000d90| 62 6f 6f 6c 65 61 6e 73 | 65 63 74 69 6f 6e 7d 2c |booleans|ection},|
|00000da0| 20 61 6c 6c 0a 76 61 6c | 75 65 73 20 63 6f 75 6e | all.val|ues coun|
|00000db0| 74 20 61 73 20 74 72 75 | 65 20 69 6e 20 73 75 63 |t as tru|e in suc|
|00000dc0| 68 20 61 20 74 65 73 74 | 20 65 78 63 65 70 74 20 |h a test| except |
|00000dd0| 66 6f 72 20 5c 73 63 68 | 66 61 6c 73 65 7b 7d 20 |for \sch|false{} |
|00000de0| 61 6e 64 20 74 68 65 20 | 65 6d 70 74 79 0a 6c 69 |and the |empty.li|
|00000df0| 73 74 2c 20 77 68 69 63 | 68 20 63 6f 75 6e 74 20 |st, whic|h count |
|00000e00| 61 73 20 66 61 6c 73 65 | 2e 20 20 54 68 69 73 20 |as false|. This |
|00000e10| 72 65 70 6f 72 74 20 75 | 73 65 73 20 74 68 65 20 |report u|ses the |
|00000e20| 77 6f 72 64 20 60 60 74 | 72 75 65 27 27 20 74 6f |word ``t|rue'' to|
|00000e30| 20 72 65 66 65 72 0a 74 | 6f 20 61 6e 79 20 53 63 | refer.t|o any Sc|
|00000e40| 68 65 6d 65 20 76 61 6c | 75 65 20 74 68 61 74 20 |heme val|ue that |
|00000e50| 63 6f 75 6e 74 73 20 61 | 73 20 74 72 75 65 2c 20 |counts a|s true, |
|00000e60| 61 6e 64 20 74 68 65 20 | 77 6f 72 64 20 60 60 66 |and the |word ``f|
|00000e70| 61 6c 73 65 27 27 20 74 | 6f 20 72 65 66 65 72 0a |alse'' t|o refer.|
|00000e80| 74 6f 20 61 6e 79 20 53 | 63 68 65 6d 65 20 76 61 |to any S|cheme va|
|00000e90| 6c 75 65 20 74 68 61 74 | 20 63 6f 75 6e 74 73 20 |lue that| counts |
|00000ea0| 61 73 20 66 61 6c 73 65 | 2e 0a 5c 6d 61 69 6e 69 |as false|..\maini|
|00000eb0| 6e 64 65 78 7b 74 72 75 | 65 7d 20 5c 6d 61 69 6e |ndex{tru|e} \main|
|00000ec0| 69 6e 64 65 78 7b 66 61 | 6c 73 65 7d 0a 0a 5c 74 |index{fa|lse}..\t|
|00000ed0| 6f 64 6f 7b 42 61 72 74 | 6c 65 79 3a 20 74 69 67 |odo{Bart|ley: tig|
|00000ee0| 68 74 65 6e 20 74 68 69 | 73 20 75 70 2e 7d 0a 0a |hten thi|s up.}..|
|00000ef0| 0a 5c 73 65 63 74 69 6f | 6e 7b 45 78 74 65 72 6e |.\sectio|n{Extern|
|00000f00| 61 6c 20 72 65 70 72 65 | 73 65 6e 74 61 74 69 6f |al repre|sentatio|
|00000f10| 6e 73 7d 0a 5c 6c 61 62 | 65 6c 7b 65 78 74 65 72 |ns}.\lab|el{exter|
|00000f20| 6e 61 6c 72 65 70 73 7d | 0a 0a 41 6e 20 69 6d 70 |nalreps}|..An imp|
|00000f30| 6f 72 74 61 6e 74 20 63 | 6f 6e 63 65 70 74 20 69 |ortant c|oncept i|
|00000f40| 6e 20 53 63 68 65 6d 65 | 20 28 61 6e 64 20 4c 69 |n Scheme| (and Li|
|00000f50| 73 70 29 20 69 73 20 74 | 68 61 74 20 6f 66 20 74 |sp) is t|hat of t|
|00000f60| 68 65 20 7b 5c 65 6d 20 | 65 78 74 65 72 6e 61 6c |he {\em |external|
|00000f70| 0a 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 7d |.represe|ntation}|
|00000f80| 20 6f 66 20 61 6e 20 6f | 62 6a 65 63 74 20 61 73 | of an o|bject as|
|00000f90| 20 61 20 73 65 71 75 65 | 6e 63 65 20 6f 66 20 63 | a seque|nce of c|
|00000fa0| 68 61 72 61 63 74 65 72 | 73 2e 20 20 46 6f 72 20 |haracter|s. For |
|00000fb0| 65 78 61 6d 70 6c 65 2c | 0a 61 6e 20 65 78 74 65 |example,|.an exte|
|00000fc0| 72 6e 61 6c 20 72 65 70 | 72 65 73 65 6e 74 61 74 |rnal rep|resentat|
|00000fd0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 69 6e 74 65 67 |ion of t|he integ|
|00000fe0| 65 72 20 32 38 20 69 73 | 20 74 68 65 20 73 65 71 |er 28 is| the seq|
|00000ff0| 75 65 6e 63 65 20 6f 66 | 0a 63 68 61 72 61 63 74 |uence of|.charact|
|00001000| 65 72 73 20 60 60 7b 5c | 74 74 20 32 38 7d 27 27 |ers ``{\|tt 28}''|
|00001010| 2c 20 61 6e 64 20 61 6e | 20 65 78 74 65 72 6e 61 |, and an| externa|
|00001020| 6c 20 72 65 70 72 65 73 | 65 6e 74 61 74 69 6f 6e |l repres|entation|
|00001030| 20 6f 66 20 61 20 6c 69 | 73 74 20 63 6f 6e 73 69 | of a li|st consi|
|00001040| 73 74 69 6e 67 0a 6f 66 | 20 74 68 65 20 69 6e 74 |sting.of| the int|
|00001050| 65 67 65 72 73 20 38 20 | 61 6e 64 20 31 33 20 69 |egers 8 |and 13 i|
|00001060| 73 20 74 68 65 20 73 65 | 71 75 65 6e 63 65 20 6f |s the se|quence o|
|00001070| 66 20 63 68 61 72 61 63 | 74 65 72 73 20 60 60 7b |f charac|ters ``{|
|00001080| 5c 74 74 28 38 20 31 33 | 29 7d 27 27 2e 0a 0a 54 |\tt(8 13|)}''...T|
|00001090| 68 65 20 65 78 74 65 72 | 6e 61 6c 20 72 65 70 72 |he exter|nal repr|
|000010a0| 65 73 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 61 6e |esentati|on of an|
|000010b0| 20 6f 62 6a 65 63 74 20 | 69 73 20 6e 6f 74 20 6e | object |is not n|
|000010c0| 65 63 65 73 73 61 72 69 | 6c 79 20 75 6e 69 71 75 |ecessari|ly uniqu|
|000010d0| 65 2e 20 20 54 68 65 0a | 69 6e 74 65 67 65 72 20 |e. The.|integer |
|000010e0| 32 38 20 61 6c 73 6f 20 | 68 61 73 20 72 65 70 72 |28 also |has repr|
|000010f0| 65 73 65 6e 74 61 74 69 | 6f 6e 73 20 60 60 7b 5c |esentati|ons ``{\|
|00001100| 74 74 20 5c 23 65 32 38 | 2e 30 30 30 7d 27 27 20 |tt \#e28|.000}'' |
|00001110| 61 6e 64 20 60 60 7b 5c | 74 74 5c 23 78 31 63 7d |and ``{\|tt\#x1c}|
|00001120| 27 27 2c 20 61 6e 64 20 | 74 68 65 0a 6c 69 73 74 |'', and |the.list|
|00001130| 20 69 6e 20 74 68 65 20 | 70 72 65 76 69 6f 75 73 | in the |previous|
|00001140| 20 70 61 72 61 67 72 61 | 70 68 20 61 6c 73 6f 20 | paragra|ph also |
|00001150| 68 61 73 20 74 68 65 20 | 72 65 70 72 65 73 65 6e |has the |represen|
|00001160| 74 61 74 69 6f 6e 73 20 | 60 60 7b 5c 74 74 28 20 |tations |``{\tt( |
|00001170| 30 38 20 31 33 0a 29 7d | 27 27 20 61 6e 64 20 60 |08 13.)}|'' and `|
|00001180| 60 7b 5c 74 74 28 38 20 | 2e 5c 20 28 31 33 20 2e |`{\tt(8 |.\ (13 .|
|00001190| 5c 20 28 29 29 29 7d 27 | 27 20 28 73 65 65 20 73 |\ ()))}'|' (see s|
|000011a0| 65 63 74 69 6f 6e 7e 5c | 72 65 66 7b 6c 69 73 74 |ection~\|ref{list|
|000011b0| 73 65 63 74 69 6f 6e 7d | 29 2e 0a 0a 4d 61 6e 79 |section}|)...Many|
|000011c0| 20 6f 62 6a 65 63 74 73 | 20 68 61 76 65 20 73 74 | objects| have st|
|000011d0| 61 6e 64 61 72 64 20 65 | 78 74 65 72 6e 61 6c 20 |andard e|xternal |
|000011e0| 72 65 70 72 65 73 65 6e | 74 61 74 69 6f 6e 73 2c |represen|tations,|
|000011f0| 20 62 75 74 20 73 6f 6d | 65 2c 20 73 75 63 68 20 | but som|e, such |
|00001200| 61 73 0a 70 72 6f 63 65 | 64 75 72 65 73 2c 20 64 |as.proce|dures, d|
|00001210| 6f 20 6e 6f 74 20 68 61 | 76 65 20 73 74 61 6e 64 |o not ha|ve stand|
|00001220| 61 72 64 20 72 65 70 72 | 65 73 65 6e 74 61 74 69 |ard repr|esentati|
|00001230| 6f 6e 73 20 28 61 6c 74 | 68 6f 75 67 68 20 70 61 |ons (alt|hough pa|
|00001240| 72 74 69 63 75 6c 61 72 | 0a 69 6d 70 6c 65 6d 65 |rticular|.impleme|
|00001250| 6e 74 61 74 69 6f 6e 73 | 20 6d 61 79 20 64 65 66 |ntations| may def|
|00001260| 69 6e 65 20 72 65 70 72 | 65 73 65 6e 74 61 74 69 |ine repr|esentati|
|00001270| 6f 6e 73 20 66 6f 72 20 | 74 68 65 6d 29 2e 0a 0a |ons for |them)...|
|00001280| 41 6e 20 65 78 74 65 72 | 6e 61 6c 20 72 65 70 72 |An exter|nal repr|
|00001290| 65 73 65 6e 74 61 74 69 | 6f 6e 20 6d 61 79 20 62 |esentati|on may b|
|000012a0| 65 20 77 72 69 74 74 65 | 6e 20 69 6e 20 61 20 70 |e writte|n in a p|
|000012b0| 72 6f 67 72 61 6d 20 74 | 6f 20 6f 62 74 61 69 6e |rogram t|o obtain|
|000012c0| 20 74 68 65 0a 63 6f 72 | 72 65 73 70 6f 6e 64 69 | the.cor|respondi|
|000012d0| 6e 67 20 6f 62 6a 65 63 | 74 20 28 73 65 65 20 5c |ng objec|t (see \|
|000012e0| 69 64 65 7b 71 75 6f 74 | 65 7d 2c 20 73 65 63 74 |ide{quot|e}, sect|
|000012f0| 69 6f 6e 7e 5c 72 65 66 | 7b 71 75 6f 74 65 7d 29 |ion~\ref|{quote})|
|00001300| 2e 0a 0a 45 78 74 65 72 | 6e 61 6c 20 72 65 70 72 |...Exter|nal repr|
|00001310| 65 73 65 6e 74 61 74 69 | 6f 6e 73 20 63 61 6e 20 |esentati|ons can |
|00001320| 61 6c 73 6f 20 62 65 20 | 75 73 65 64 20 66 6f 72 |also be |used for|
|00001330| 20 69 6e 70 75 74 20 61 | 6e 64 20 6f 75 74 70 75 | input a|nd outpu|
|00001340| 74 2e 20 20 54 68 65 0a | 70 72 6f 63 65 64 75 72 |t. The.|procedur|
|00001350| 65 20 5c 69 64 65 7b 72 | 65 61 64 7d 20 28 73 65 |e \ide{r|ead} (se|
|00001360| 63 74 69 6f 6e 7e 5c 72 | 65 66 7b 72 65 61 64 7d |ction~\r|ef{read}|
|00001370| 29 20 70 61 72 73 65 73 | 20 65 78 74 65 72 6e 61 |) parses| externa|
|00001380| 6c 0a 72 65 70 72 65 73 | 65 6e 74 61 74 69 6f 6e |l.repres|entation|
|00001390| 73 2c 20 61 6e 64 20 74 | 68 65 20 70 72 6f 63 65 |s, and t|he proce|
|000013a0| 64 75 72 65 20 5c 69 64 | 65 7b 77 72 69 74 65 7d |dure \id|e{write}|
|000013b0| 20 28 73 65 63 74 69 6f | 6e 7e 5c 72 65 66 7b 77 | (sectio|n~\ref{w|
|000013c0| 72 69 74 65 7d 29 0a 67 | 65 6e 65 72 61 74 65 73 |rite}).g|enerates|
|000013d0| 20 74 68 65 6d 2e 20 20 | 54 6f 67 65 74 68 65 72 | them. |Together|
|000013e0| 2c 20 74 68 65 79 20 70 | 72 6f 76 69 64 65 20 61 |, they p|rovide a|
|000013f0| 6e 20 65 6c 65 67 61 6e | 74 20 61 6e 64 20 70 6f |n elegan|t and po|
|00001400| 77 65 72 66 75 6c 0a 69 | 6e 70 75 74 2f 6f 75 74 |werful.i|nput/out|
|00001410| 70 75 74 20 66 61 63 69 | 6c 69 74 79 2e 0a 0a 4e |put faci|lity...N|
|00001420| 6f 74 65 20 74 68 61 74 | 20 74 68 65 20 73 65 71 |ote that| the seq|
|00001430| 75 65 6e 63 65 20 6f 66 | 20 63 68 61 72 61 63 74 |uence of| charact|
|00001440| 65 72 73 20 60 60 7b 5c | 74 74 28 2b 20 32 20 36 |ers ``{\|tt(+ 2 6|
|00001450| 29 7d 27 27 20 69 73 20 | 7b 5c 65 6d 20 6e 6f 74 |)}'' is |{\em not|
|00001460| 7d 20 61 6e 0a 65 78 74 | 65 72 6e 61 6c 20 72 65 |} an.ext|ernal re|
|00001470| 70 72 65 73 65 6e 74 61 | 74 69 6f 6e 20 6f 66 20 |presenta|tion of |
|00001480| 74 68 65 20 69 6e 74 65 | 67 65 72 20 38 2c 20 65 |the inte|ger 8, e|
|00001490| 76 65 6e 20 74 68 6f 75 | 67 68 20 69 74 20 7b 5c |ven thou|gh it {\|
|000014a0| 65 6d 20 69 73 7d 20 61 | 6e 0a 65 78 70 72 65 73 |em is} a|n.expres|
|000014b0| 73 69 6f 6e 20 65 76 61 | 6c 75 61 74 69 6e 67 20 |sion eva|luating |
|000014c0| 74 6f 20 74 68 65 20 69 | 6e 74 65 67 65 72 20 38 |to the i|nteger 8|
|000014d0| 3b 20 72 61 74 68 65 72 | 2c 20 69 74 20 69 73 20 |; rather|, it is |
|000014e0| 61 6e 20 65 78 74 65 72 | 6e 61 6c 0a 72 65 70 72 |an exter|nal.repr|
|000014f0| 65 73 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 61 20 |esentati|on of a |
|00001500| 74 68 72 65 65 2d 65 6c | 65 6d 65 6e 74 20 6c 69 |three-el|ement li|
|00001510| 73 74 2c 20 74 68 65 20 | 65 6c 65 6d 65 6e 74 73 |st, the |elements|
|00001520| 20 6f 66 20 77 68 69 63 | 68 20 61 72 65 20 74 68 | of whic|h are th|
|00001530| 65 20 73 79 6d 62 6f 6c | 0a 7b 5c 74 74 20 2b 7d |e symbol|.{\tt +}|
|00001540| 20 61 6e 64 20 74 68 65 | 20 69 6e 74 65 67 65 72 | and the| integer|
|00001550| 73 20 32 20 61 6e 64 20 | 36 2e 20 20 53 63 68 65 |s 2 and |6. Sche|
|00001560| 6d 65 27 73 20 73 79 6e | 74 61 78 20 68 61 73 20 |me's syn|tax has |
|00001570| 74 68 65 20 70 72 6f 70 | 65 72 74 79 20 74 68 61 |the prop|erty tha|
|00001580| 74 0a 61 6e 79 20 73 65 | 71 75 65 6e 63 65 20 6f |t.any se|quence o|
|00001590| 66 20 63 68 61 72 61 63 | 74 65 72 73 20 77 68 69 |f charac|ters whi|
|000015a0| 63 68 20 69 73 20 61 6e | 20 65 78 70 72 65 73 73 |ch is an| express|
|000015b0| 69 6f 6e 20 69 73 20 61 | 6c 73 6f 20 74 68 65 20 |ion is a|lso the |
|000015c0| 65 78 74 65 72 6e 61 6c | 0a 72 65 70 72 65 73 65 |external|.represe|
|000015d0| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 73 6f 6d 65 20 |ntation |of some |
|000015e0| 6f 62 6a 65 63 74 2e 20 | 20 54 68 69 73 20 63 61 |object. | This ca|
|000015f0| 6e 20 6c 65 61 64 20 74 | 6f 20 63 6f 6e 66 75 73 |n lead t|o confus|
|00001600| 69 6f 6e 2c 20 73 69 6e | 63 65 20 69 74 20 6d 61 |ion, sin|ce it ma|
|00001610| 79 0a 6e 6f 74 20 62 65 | 20 6f 62 76 69 6f 75 73 |y.not be| obvious|
|00001620| 20 6f 75 74 20 6f 66 20 | 63 6f 6e 74 65 78 74 20 | out of |context |
|00001630| 77 68 65 74 68 65 72 20 | 61 20 67 69 76 65 6e 20 |whether |a given |
|00001640| 73 65 71 75 65 6e 63 65 | 20 6f 66 20 63 68 61 72 |sequence| of char|
|00001650| 61 63 74 65 72 73 20 69 | 73 0a 69 6e 74 65 6e 64 |acters i|s.intend|
|00001660| 65 64 20 74 6f 20 64 65 | 6e 6f 74 65 20 64 61 74 |ed to de|note dat|
|00001670| 61 20 6f 72 20 70 72 6f | 67 72 61 6d 2c 20 62 75 |a or pro|gram, bu|
|00001680| 74 20 69 74 20 69 73 20 | 61 6c 73 6f 20 61 20 73 |t it is |also a s|
|00001690| 6f 75 72 63 65 20 6f 66 | 20 70 6f 77 65 72 2c 0a |ource of| power,.|
|000016a0| 73 69 6e 63 65 20 69 74 | 20 66 61 63 69 6c 69 74 |since it| facilit|
|000016b0| 61 74 65 73 20 77 72 69 | 74 69 6e 67 20 70 72 6f |ates wri|ting pro|
|000016c0| 67 72 61 6d 73 20 73 75 | 63 68 20 61 73 20 69 6e |grams su|ch as in|
|000016d0| 74 65 72 70 72 65 74 65 | 72 73 20 61 6e 64 0a 63 |terprete|rs and.c|
|000016e0| 6f 6d 70 69 6c 65 72 73 | 20 77 68 69 63 68 20 74 |ompilers| which t|
|000016f0| 72 65 61 74 20 70 72 6f | 67 72 61 6d 73 20 61 73 |reat pro|grams as|
|00001700| 20 64 61 74 61 20 28 6f | 72 20 76 69 63 65 20 76 | data (o|r vice v|
|00001710| 65 72 73 61 29 2e 0a 0a | 54 68 65 20 73 79 6e 74 |ersa)...|The synt|
|00001720| 61 78 20 6f 66 20 65 78 | 74 65 72 6e 61 6c 20 72 |ax of ex|ternal r|
|00001730| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 73 20 6f |epresent|ations o|
|00001740| 66 20 76 61 72 69 6f 75 | 73 20 6b 69 6e 64 73 20 |f variou|s kinds |
|00001750| 6f 66 20 6f 62 6a 65 63 | 74 73 0a 61 63 63 6f 6d |of objec|ts.accom|
|00001760| 70 61 6e 69 65 73 20 74 | 68 65 20 64 65 73 63 72 |panies t|he descr|
|00001770| 69 70 74 69 6f 6e 20 6f | 66 20 74 68 65 20 70 72 |iption o|f the pr|
|00001780| 69 6d 69 74 69 76 65 73 | 20 66 6f 72 20 6d 61 6e |imitives| for man|
|00001790| 69 70 75 6c 61 74 69 6e | 67 20 74 68 65 0a 6f 62 |ipulatin|g the.ob|
|000017a0| 6a 65 63 74 73 20 69 6e | 20 74 68 65 20 61 70 70 |jects in| the app|
|000017b0| 72 6f 70 72 69 61 74 65 | 20 73 65 63 74 69 6f 6e |ropriate| section|
|000017c0| 73 20 6f 66 20 63 68 61 | 70 74 65 72 7e 5c 72 65 |s of cha|pter~\re|
|000017d0| 66 7b 69 6e 69 74 69 61 | 6c 65 6e 76 7d 2e 0a 0a |f{initia|lenv}...|
|000017e0| 0a 5c 73 65 63 74 69 6f | 6e 7b 44 69 73 6a 6f 69 |.\sectio|n{Disjoi|
|000017f0| 6e 74 6e 65 73 73 20 6f | 66 20 74 79 70 65 73 7d |ntness o|f types}|
|00001800| 0a 5c 6c 61 62 65 6c 7b | 64 69 73 6a 6f 69 6e 74 |.\label{|disjoint|
|00001810| 6e 65 73 73 7d 0a 0a 4e | 6f 20 6f 62 6a 65 63 74 |ness}..N|o object|
|00001820| 20 73 61 74 69 73 66 69 | 65 73 20 6d 6f 72 65 20 | satisfi|es more |
|00001830| 74 68 61 6e 20 6f 6e 65 | 20 6f 66 20 74 68 65 20 |than one| of the |
|00001840| 66 6f 6c 6c 6f 77 69 6e | 67 20 70 72 65 64 69 63 |followin|g predic|
|00001850| 61 74 65 73 3a 0a 0a 5c | 62 65 67 69 6e 7b 73 63 |ates:..\|begin{sc|
|00001860| 68 65 6d 65 7d 0a 62 6f | 6f 6c 65 61 6e 3f 20 20 |heme}.bo|olean? |
|00001870| 20 20 20 20 20 20 20 20 | 70 61 69 72 3f 0a 73 79 | |pair?.sy|
|00001880| 6d 62 6f 6c 3f 20 20 20 | 20 20 20 20 20 20 20 20 |mbol? | |
|00001890| 6e 75 6d 62 65 72 3f 0a | 63 68 61 72 3f 20 20 20 |number?.|char? |
|000018a0| 20 20 20 20 20 20 20 20 | 20 20 73 74 72 69 6e 67 | | string|
|000018b0| 3f 0a 76 65 63 74 6f 72 | 3f 20 20 20 20 20 20 20 |?.vector|? |
|000018c0| 20 20 20 20 70 72 6f 63 | 65 64 75 72 65 3f 25 0a | proc|edure?%.|
|000018d0| 5c 65 6e 64 7b 73 63 68 | 65 6d 65 7d 0a 0a 54 68 |\end{sch|eme}..Th|
|000018e0| 65 73 65 20 70 72 65 64 | 69 63 61 74 65 73 20 64 |ese pred|icates d|
|000018f0| 65 66 69 6e 65 20 74 68 | 65 20 74 79 70 65 73 20 |efine th|e types |
|00001900| 7b 5c 65 6d 20 62 6f 6f | 6c 65 61 6e 7d 2c 20 7b |{\em boo|lean}, {|
|00001910| 5c 65 6d 20 70 61 69 72 | 7d 2c 20 7b 5c 65 6d 20 |\em pair|}, {\em |
|00001920| 73 79 6d 62 6f 6c 7d 2c | 0a 7b 5c 65 6d 20 6e 75 |symbol},|.{\em nu|
|00001930| 6d 62 65 72 7d 2c 20 7b | 5c 65 6d 20 63 68 61 72 |mber}, {|\em char|
|00001940| 7d 20 28 6f 72 20 7b 5c | 65 6d 20 63 68 61 72 61 |} (or {\|em chara|
|00001950| 63 74 65 72 7d 29 2c 20 | 7b 5c 65 6d 20 73 74 72 |cter}), |{\em str|
|00001960| 69 6e 67 7d 2c 20 7b 5c | 65 6d 20 76 65 63 74 6f |ing}, {\|em vecto|
|00001970| 72 7d 2c 20 61 6e 64 0a | 7b 5c 65 6d 20 70 72 6f |r}, and.|{\em pro|
|00001980| 63 65 64 75 72 65 7d 2e | 0a 0a 0a 5c 73 65 63 74 |cedure}.|...\sect|
|00001990| 69 6f 6e 7b 53 74 6f 72 | 61 67 65 20 6d 6f 64 65 |ion{Stor|age mode|
|000019a0| 6c 7d 0a 5c 6c 61 62 65 | 6c 7b 73 74 6f 72 61 67 |l}.\labe|l{storag|
|000019b0| 65 6d 6f 64 65 6c 7d 0a | 0a 56 61 72 69 61 62 6c |emodel}.|.Variabl|
|000019c0| 65 73 20 61 6e 64 20 6f | 62 6a 65 63 74 73 20 73 |es and o|bjects s|
|000019d0| 75 63 68 20 61 73 20 70 | 61 69 72 73 2c 20 76 65 |uch as p|airs, ve|
|000019e0| 63 74 6f 72 73 2c 20 61 | 6e 64 20 73 74 72 69 6e |ctors, a|nd strin|
|000019f0| 67 73 20 69 6d 70 6c 69 | 63 69 74 6c 79 0a 64 65 |gs impli|citly.de|
|00001a00| 6e 6f 74 65 20 6c 6f 63 | 61 74 69 6f 6e 73 5c 69 |note loc|ations\i|
|00001a10| 6e 64 65 78 7b 6c 6f 63 | 61 74 69 6f 6e 7d 20 6f |ndex{loc|ation} o|
|00001a20| 72 20 73 65 71 75 65 6e | 63 65 73 20 6f 66 20 6c |r sequen|ces of l|
|00001a30| 6f 63 61 74 69 6f 6e 73 | 2e 20 20 41 20 73 74 72 |ocations|. A str|
|00001a40| 69 6e 67 2c 20 66 6f 72 | 0a 65 78 61 6d 70 6c 65 |ing, for|.example|
|00001a50| 2c 20 64 65 6e 6f 74 65 | 73 20 61 73 20 6d 61 6e |, denote|s as man|
|00001a60| 79 20 6c 6f 63 61 74 69 | 6f 6e 73 20 61 73 20 74 |y locati|ons as t|
|00001a70| 68 65 72 65 20 61 72 65 | 20 63 68 61 72 61 63 74 |here are| charact|
|00001a80| 65 72 73 20 69 6e 20 74 | 68 65 20 73 74 72 69 6e |ers in t|he strin|
|00001a90| 67 2e 20 0a 28 54 68 65 | 73 65 20 6c 6f 63 61 74 |g. .(The|se locat|
|00001aa0| 69 6f 6e 73 20 6e 65 65 | 64 20 6e 6f 74 20 63 6f |ions nee|d not co|
|00001ab0| 72 72 65 73 70 6f 6e 64 | 20 74 6f 20 61 20 66 75 |rrespond| to a fu|
|00001ac0| 6c 6c 20 6d 61 63 68 69 | 6e 65 20 77 6f 72 64 2e |ll machi|ne word.|
|00001ad0| 29 20 41 20 6e 65 77 20 | 76 61 6c 75 65 20 6d 61 |) A new |value ma|
|00001ae0| 79 20 62 65 0a 73 74 6f | 72 65 64 20 69 6e 74 6f |y be.sto|red into|
|00001af0| 20 6f 6e 65 20 6f 66 20 | 74 68 65 73 65 20 6c 6f | one of |these lo|
|00001b00| 63 61 74 69 6f 6e 73 20 | 75 73 69 6e 67 20 74 68 |cations |using th|
|00001b10| 65 20 7b 5c 74 74 20 73 | 74 72 69 6e 67 2d 73 65 |e {\tt s|tring-se|
|00001b20| 74 21 7d 20 70 72 6f 63 | 65 64 75 72 65 2c 20 62 |t!} proc|edure, b|
|00001b30| 75 74 0a 74 68 65 20 73 | 74 72 69 6e 67 20 63 6f |ut.the s|tring co|
|00001b40| 6e 74 69 6e 75 65 73 20 | 74 6f 20 64 65 6e 6f 74 |ntinues |to denot|
|00001b50| 65 20 74 68 65 20 73 61 | 6d 65 20 6c 6f 63 61 74 |e the sa|me locat|
|00001b60| 69 6f 6e 73 20 61 73 20 | 62 65 66 6f 72 65 2e 0a |ions as |before..|
|00001b70| 0a 45 76 65 72 79 20 6c | 6f 63 61 74 69 6f 6e 20 |.Every l|ocation |
|00001b80| 69 73 20 6d 61 72 6b 65 | 64 20 74 6f 20 73 68 6f |is marke|d to sho|
|00001b90| 77 20 77 68 65 74 68 65 | 72 20 69 74 20 69 73 20 |w whethe|r it is |
|00001ba0| 69 6e 20 75 73 65 2e 0a | 4e 6f 20 76 61 72 69 61 |in use..|No varia|
|00001bb0| 62 6c 65 20 6f 72 20 6f | 62 6a 65 63 74 20 65 76 |ble or o|bject ev|
|00001bc0| 65 72 20 72 65 66 65 72 | 73 20 74 6f 20 61 20 6c |er refer|s to a l|
|00001bd0| 6f 63 61 74 69 6f 6e 20 | 74 68 61 74 20 69 73 20 |ocation |that is |
|00001be0| 6e 6f 74 20 69 6e 20 75 | 73 65 2e 0a 57 68 65 6e |not in u|se..When|
|00001bf0| 65 76 65 72 20 74 68 69 | 73 20 72 65 70 6f 72 74 |ever thi|s report|
|00001c00| 20 73 70 65 61 6b 73 20 | 6f 66 20 73 74 6f 72 61 | speaks |of stora|
|00001c10| 67 65 20 62 65 69 6e 67 | 20 61 6c 6c 6f 63 61 74 |ge being| allocat|
|00001c20| 65 64 20 66 6f 72 20 61 | 20 76 61 72 69 61 62 6c |ed for a| variabl|
|00001c30| 65 0a 6f 72 20 6f 62 6a | 65 63 74 2c 20 77 68 61 |e.or obj|ect, wha|
|00001c40| 74 20 69 73 20 6d 65 61 | 6e 74 20 69 73 20 74 68 |t is mea|nt is th|
|00001c50| 61 74 20 61 6e 20 61 70 | 70 72 6f 70 72 69 61 74 |at an ap|propriat|
|00001c60| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 6c 6f 63 61 |e number| of loca|
|00001c70| 74 69 6f 6e 73 20 61 72 | 65 0a 63 68 6f 73 65 6e |tions ar|e.chosen|
|00001c80| 20 66 72 6f 6d 20 74 68 | 65 20 73 65 74 20 6f 66 | from th|e set of|
|00001c90| 20 6c 6f 63 61 74 69 6f | 6e 73 20 74 68 61 74 20 | locatio|ns that |
|00001ca0| 61 72 65 20 6e 6f 74 20 | 69 6e 20 75 73 65 2c 20 |are not |in use, |
|00001cb0| 61 6e 64 20 74 68 65 20 | 63 68 6f 73 65 6e 0a 6c |and the |chosen.l|
|00001cc0| 6f 63 61 74 69 6f 6e 73 | 20 61 72 65 20 6d 61 72 |ocations| are mar|
|00001cd0| 6b 65 64 20 74 6f 20 69 | 6e 64 69 63 61 74 65 20 |ked to i|ndicate |
|00001ce0| 74 68 61 74 20 74 68 65 | 79 20 61 72 65 20 6e 6f |that the|y are no|
|00001cf0| 77 20 69 6e 20 75 73 65 | 20 62 65 66 6f 72 65 20 |w in use| before |
|00001d00| 74 68 65 20 76 61 72 69 | 61 62 6c 65 0a 6f 72 20 |the vari|able.or |
|00001d10| 6f 62 6a 65 63 74 20 69 | 73 20 6d 61 64 65 20 74 |object i|s made t|
|00001d20| 6f 20 64 65 6e 6f 74 65 | 20 74 68 65 6d 2e 0a 0a |o denote| them...|
|00001d30| 49 6e 20 6d 61 6e 79 20 | 73 79 73 74 65 6d 73 20 |In many |systems |
|00001d40| 69 74 20 69 73 20 64 65 | 73 69 72 61 62 6c 65 20 |it is de|sirable |
|00001d50| 66 6f 72 20 63 6f 6e 73 | 74 61 6e 74 73 20 28 69 |for cons|tants (i|
|00001d60| 2e 65 2e 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 |.e. the |value of|
|00001d70| 20 61 20 6c 69 74 65 72 | 61 6c 0a 65 78 70 72 65 | a liter|al.expre|
|00001d80| 73 73 69 6f 6e 29 20 74 | 6f 20 72 65 73 69 64 65 |ssion) t|o reside|
|00001d90| 20 69 6e 20 72 65 61 64 | 2d 6f 6e 6c 79 2d 6d 65 | in read|-only-me|
|00001da0| 6d 6f 72 79 2e 20 20 54 | 6f 20 65 78 70 72 65 73 |mory. T|o expres|
|00001db0| 73 20 74 68 69 73 2c 20 | 69 74 20 69 73 20 63 6f |s this, |it is co|
|00001dc0| 6e 76 65 6e 69 65 6e 74 | 0a 74 6f 20 69 6d 61 67 |nvenient|.to imag|
|00001dd0| 69 6e 65 20 74 68 61 74 | 20 65 76 65 72 79 20 6f |ine that| every o|
|00001de0| 62 6a 65 63 74 20 74 68 | 61 74 20 64 65 6e 6f 74 |bject th|at denot|
|00001df0| 65 73 20 6c 6f 63 61 74 | 69 6f 6e 73 20 69 73 20 |es locat|ions is |
|00001e00| 61 73 73 6f 63 69 61 74 | 65 64 20 77 69 74 68 20 |associat|ed with |
|00001e10| 61 20 66 6c 61 67 0a 74 | 65 6c 6c 69 6e 67 20 77 |a flag.t|elling w|
|00001e20| 68 65 74 68 65 72 20 74 | 68 61 74 20 6f 62 6a 65 |hether t|hat obje|
|00001e30| 63 74 20 69 73 20 6d 75 | 74 61 62 6c 65 5c 69 6e |ct is mu|table\in|
|00001e40| 64 65 78 7b 6d 75 74 61 | 62 6c 65 7d 20 6f 72 0a |dex{muta|ble} or.|
|00001e50| 69 6d 6d 75 74 61 62 6c | 65 5c 69 6e 64 65 78 7b |immutabl|e\index{|
|00001e60| 69 6d 6d 75 74 61 62 6c | 65 7d 2e 20 20 54 68 65 |immutabl|e}. The|
|00001e70| 20 63 6f 6e 73 74 61 6e | 74 73 20 61 72 65 20 74 | constan|ts are t|
|00001e80| 68 65 6e 20 74 68 65 20 | 69 6d 6d 75 74 61 62 6c |hen the |immutabl|
|00001e90| 65 20 6f 62 6a 65 63 74 | 73 2c 20 77 68 69 6c 65 |e object|s, while|
|00001ea0| 0a 61 6c 6c 20 6f 62 6a | 65 63 74 73 20 63 72 65 |.all obj|ects cre|
|00001eb0| 61 74 65 64 20 62 79 20 | 74 68 65 20 70 72 6f 63 |ated by |the proc|
|00001ec0| 65 64 75 72 65 73 20 6c | 69 73 74 65 64 20 69 6e |edures l|isted in|
|00001ed0| 20 74 68 69 73 20 72 65 | 70 6f 72 74 20 61 72 65 | this re|port are|
|00001ee0| 20 6d 75 74 61 62 6c 65 | 2e 20 20 49 74 20 69 73 | mutable|. It is|
|00001ef0| 0a 61 6e 20 65 72 72 6f | 72 20 74 6f 20 61 74 74 |.an erro|r to att|
|00001f00| 65 6d 70 74 20 74 6f 20 | 73 74 6f 72 65 20 61 20 |empt to |store a |
|00001f10| 6e 65 77 20 76 61 6c 75 | 65 20 69 6e 74 6f 20 61 |new valu|e into a|
|00001f20| 20 6c 6f 63 61 74 69 6f | 6e 20 74 68 61 74 20 69 | locatio|n that i|
|00001f30| 73 20 64 65 6e 6f 74 65 | 64 0a 62 79 20 61 6e 20 |s denote|d.by an |
|00001f40| 69 6d 6d 75 74 61 62 6c | 65 20 6f 62 6a 65 63 74 |immutabl|e object|
|00001f50| 2e 0a | |.. | |
+--------+-------------------------+-------------------------+--------+--------+